#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    int lengthOfLIS(vector<int> &nums)
    {
        vector<int> dp(nums.size(), 1);
        if (nums.empty())
            return 0;
        for (int i = nums.size() - 1; i >= 0; i--)
        {
            for (int nextBigger = i; nextBigger < nums.size(); nextBigger++)
            {
                if (nums[i] < nums[nextBigger])
                {
                    dp[i] = max(dp[i], dp[nextBigger] + 1);
                }
            }
        }
        return *max_element(dp.begin(), dp.end());
    }
};
int main()
{
    cout << "Code300" << endl;
    Solution s;
    vector<int> nums = {10, 9, 2, 5, 3, 7, 101, 18};
    cout << s.lengthOfLIS(nums) << endl;
    return 0;
}